home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 24
/
Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso
/
Aminet
/
dev
/
c
/
cxref_1_4a.lha
/
README
< prev
next >
Wrap
Text File
|
1997-12-07
|
17KB
|
345 lines
C Cross Referencing & Documenting tool. Version 1.4a - cxref
============================================================
A program that can automatically generate documentation and cross references for
a C program.
The input is any C program with appropriate comments and the output is LaTeX or
HTML files.
--------------------------------------------------------------------------------
------------------------------- Program Options --------------------------------
--------------------------------------------------------------------------------
The name of the program is cxref.
Usage: cxref filename [ ... filename]
[-Odirname] [-Nbasename] [-Rdirname]
[-all-comments] [-no-comments]
[-verbatim-comments] [-block-comments]
[-xref[-all][-file][-func][-var][-type]]
[-warn[-all][-comment][-xref]]
[-index[-all][-file][-func][-var][-type]]
[-raw]
[-latex|-latex2e]
[-html]
[-Idirname] [-Ddefine] [-Udefine]
[-CPP cpp_program] [-- cpp_arg [ ... cpp_arg]]
Usage: cxref filename [ ... filename] -delete
[-Odirname] [-Nbasename] [-Rdirname]
filename The name of the file to document, any number of files may be
documented at a time.
-delete The files named are to be deleted from the output directory and
their entries in the cross reference database and main output
files are to be removed.
-Odirname The name of a directory to use for the output latex files and
the location of the cross reference files that are created.
-Nbasename The name to use for the first part of the output and cross
reference files instead of cxref, the file extensions remain
the same.
-Rdirname When the source files are in more than one directory, set
dirname to the name of the root directory of the source tree
(use relative path if easier e.g. `-R../..'). This will then
run cxref from that root directory and the `-Odirname' must be
relative to that directory.
-all-comments In case you think that the existing comments might work,
(see below for description of special comments).
[Danger! This option can produce weird results.]
-no-comments Ignores all comments, useful if you just want the cross
references and not the documentation.
-verbatim-comments When the comments that you have in the code are formatted
in a predetermined style that you want to preserve on the
output, this option will force them not to be reformatted.
[Note, this is for file and function comments only.]
-block-comments When the comments in the program are formatted in the `block'
style (with a leading `*' character on every line), this option
will remove that character from the output.
[Works for a single `*', `+', `|' or `:' on each line.]
-xref Produce cross referencing information (see below).
-all All cross references.
-file Cross references for files.
-func Cross references for functions.
-var Cross references for variables.
-type Cross references for types.
-warn Produce warnings, the options must be concatenated together:
-all All warnings.
-comment Warn of missing comments.
-xref Warn of missing cross references.
-index Produce a cross reference index, the options must be
concatenated together:
-all All indexes.
-file Index of files.
-func Index of functions.
-var Index of variables.
-type Index of types.
-raw Produce a raw form of output, not really of much use except
with -warn.
-latex Produce a LaTeX file to document each of the source files and
also an extra file that includes each of these files.
-latex2e Produce the LaTeX file described above for use with the
LaTeX2e version of LaTeX.
-html Produce an HTML file to document each of the source files and
a main file to reference each of these files.
-Idirname GCC option to specify the path for include files.
-Ddefine GCC option to define a pre-processor symbol.
-Udefine GCC option to undefine a pre-processor symbol.
-CPP program The name of the program to use instead of the compile time
default. The program must be able to perform all of the actions
that `gcc -E -C -dD' does to work. If the program takes
arguments then the whole thing needs to be in quotes so that it
is interpreted as a single argument to cxref.
-- arg ... arg Extra arguments to be passed to the pre-processor can be placed
after the `--' separator.
--------------------------------------------------------------------------------
----------------------- C Compiler Replacement cxref-cc ------------------------
--------------------------------------------------------------------------------
To simplify using cxref on existing source code, there is now a shell script
that will call the C compiler and then call cxref to process the source file.
This means that it can be used as a drop in replacement for CC in Makefiles and
the like.
Usage: cxref-cc [usual cc options]
The name of the source file is extracted from the list of options as well as the
`-D*', `-I*', `-U*' flags and when the C compiler exits succesfully cxref will
be called. The name of the C compiler to use is controlled by the CXREFCC
environment variable, or if this is not set then the CC environment variable, or
failing this just gcc.
Using this script requires the use of a `.cxref' configuration file to contain
the options since there is nowhere to put the options on the command line for
the C compiler.
This will only cross-reference and document the C source files since they are
the only ones that are compiled, but it will make sure that they are
cross-referenced with the correct options etc.
--------------------------------------------------------------------------------
----------------------- Cxref configuration File .cxref ------------------------
--------------------------------------------------------------------------------
These command line arguments can also be put into a file named `.cxref' instead
of on the command line. When cxref is run the arguments to the program are
interpreted in the following order.
1) Those on the command line.
2) Those in the `.cxref' file in the current directory.
3) Those in the `.cxref' file in the source tree root specified by `-R'.
This means that in a multi-directory source tree, each sub-directory can have a
`.cxref' file containing just the line `-R..' or appropriate. The main
directory can have a `.cxref' file containing the remainder of the options.
This removes completely the need to have any options on the command line apart
from the source file names.
The format of the `.cxref' file is any number of lines, each one containing a
single command line argument (equivalent to one of the argv). The only options
that cannot be used are the names of source files themselves and the `-delete'
option. Blank lines are ignored and lines starting with a '#' are comments.
--------------------------------------------------------------------------------
------------------------ Program Documentation Comments ------------------------
--------------------------------------------------------------------------------
The documentation for the program is produced from comments in the code that are
appropriately formatted. The cross referencing comes from the code itself and
requires no extra work.
The special comments are `/**** ****/' (for a file) and `/*++